package day4.liberary;
import day4.liberary.book1.booklist;
import day4.liberary.operator.*;
import day4.liberary.user.*;

import javax.crypto.spec.DESedeKeySpec;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: watermelon
 * Date: 2025-05-30
 * Time: 22:17
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.print("请输入姓名:");
        String name=scanner.next();
        booklist list=new booklist();
        int deficity=1;
        do {
            System.out.println("请输入进入书库的模式:");
            System.out.println("1-管理员模式  2-用户模式  0-退出程序");
            deficity=scanner.nextInt();
            if(deficity==1)
            {
                administer mode=new administer(name);
                int option=1;
                while(option!=0) {
                    mode.meun();
                    System.out.print("请输入需要进行的操作:");
                    option = scanner.nextInt();
                    mode.alljob[option].working(list);
                }
            }
            else if(deficity==2)
            {
                user mode=new user(name);
                int option=1;
                while(option!=0) {
                    mode.meun();
                    System.out.print("请输入需要进行的操作:");
                    option = scanner.nextInt();
                    mode.alljob[option].working(list);
                }
            }
            else if(deficity==0)
            {
                System.out.println("退出成功");
            }
            else
            {
                System.out.println("输入错误,请重新输入");
            }
        }while(deficity!=0);
    }
}
